package com.zx.role.service.impl;

import com.zx.role.domain.SysRole;
import com.zx.role.domain.SysUser;
import com.zx.role.mapper.SysRoleMapper;
import com.zx.role.service.SysRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysRoleServiceImpl implements SysRoleService {

    @Resource
    private SysRoleMapper sysRoleMapper;

    @Override
    public SysRole selectById(Integer id) {
        return sysRoleMapper.selectById(id);
    }

    @Override
    public List<SysRole> selectObjects(SysRole entity) {
        return sysRoleMapper.selectObjects(entity);
    }

    @Override
    public int insertObject(SysRole entity) {
        return sysRoleMapper.insertObject(entity);
    }

    @Override
    public int updateObject(SysRole entity) {
        return sysRoleMapper.updateObject(entity);
    }

    @Override
    public int deleteObject(SysRole entity) {
        return sysRoleMapper.deleteObject(entity);
    }

    @Override
    public int deleteObjectById(Integer id) {
        return sysRoleMapper.deleteObjectById(id);
    }

    @Override
    public List<SysUser> getUserByRoleId(SysUser sysUser) {
        return sysRoleMapper.getUserByRoleId(sysUser);
    }

    @Override
    public List<SysUser> getUserListByRoleId(SysUser sysUser) {
        return sysRoleMapper.getUserListByRoleId(sysUser);
    }

    @Override
    public boolean deleteObjectOnly(Integer id) {
        return sysRoleMapper.deleteObjectOnly(id);
    }

    @Override
    public boolean bathDelRole(Integer[] haveIds) {
        return sysRoleMapper.bathDelRole(haveIds);
    }

    @Override
    public List<SysRole> getUserCountByRole() {
        return sysRoleMapper.getUserCountByRole();
    }

    @Override
    public List<SysUser> getRoleCountByUser() {
        return sysRoleMapper.getRoleCountByUser();
    }

    @Override
    public List<SysRole> getDeptCountByRole() {
        return sysRoleMapper.getDeptCountByRole();
    }

    @Override
    public List<SysRole> getMenuCountByRole() {
        return sysRoleMapper.getMenuCountByRole();
    }
}
